<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>登录</title>
    <!-- Bootstrap core CSS -->
    <link href="asserts/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/4.4.1-1/css/bootstrap.css}"
          rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="@{/iconfont/iconfont.css}" rel="stylesheet">
    <link th:href="@{/asserts/css/signin.css}" rel="stylesheet">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.12.5/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/js/bootstrap.min.js"></script>

</head>
<body class="text-center">
<form class="form-signin" th:action="@{/admin/login}" method="post">
    <!--    <div class="alert alert-danger alert-dismissible fade show">-->
    <h3>员工管理系统</h3>
    <h5 class="btn-outline-success ">管理员</h5>
    <br>
    <div class="alert  alert-dismissible fade show">
        <button type="button" class="close" data-dismiss="alert"></button>
        <!--        <button type="button" class="close" data-dismiss="alert">&times;</button>-->
        <strong class="text-danger" th:text="${msg}" th:if="${not #strings.isEmpty(msg)}"></strong>
    </div>

    <label class="sr-only">Username</label>
    <input type="text" name="username" class="form-control" placeholder="Username"
           required="" autofocus="">
    <label class="sr-only">Password</label>
    <input type="password" name="password" class="form-control password-input password-field" placeholder="Password"
            required="">
    <div class="btn float-right text-primary" onclick="see()">显示/隐藏密码</div>
    <a class="btn float-left text-primary" type="submit"
         th:action="@{/user/login}"
         th:method="get"
         th:href="@{/user/login}"
    >切换用户</a>

    <button id="btn1" class="btn btn-lg btn-primary btn-block" type="submit"
            style="background-color: #062c33">登录
    </button>
    <a class="btn btn-lg btn-success btn-block" type="submit"
       th:action="@{/user/register}"
       th:method="get"
       th:href="@{/user/register}"
    >
        注册
    </a>



</form>
<script>
    var input = document.querySelector(".password-input");
    var flag = true
    if (input.getAttribute("type") === "password") {
        input.setAttribute("type", "text");
    } else {
        input.setAttribute("type", "password");
    }
    function see() {
        input.setAttribute("type", "text");
        if (flag == true) {
            input.setAttribute("type", "password");
            flag = false
        } else {
            input.setAttribute("type", "text");
            flag = true
        }

    }

</script>

</body>

</html>